package com.wudimeng.syll.controller.api;


import com.wudimeng.syll.common.ApiResponse;
import com.wudimeng.syll.constants.Constant;
import com.wudimeng.syll.constants.Constants;
import com.wudimeng.syll.entity.ValidateCode;
import com.wudimeng.syll.param.ClientLoginBody;
import com.wudimeng.syll.param.UpdateMimaBody;
import com.wudimeng.syll.service.IWeiTuoXinXiService;
import com.wudimeng.syll.service.IYongHuXinXiService;
import com.wudimeng.syll.utils.RedisCache;
import com.wudimeng.syll.utils.uuid.IdUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestBindingException;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.ServletWebRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * @Author laohei
 * @Date 2020/6/8 9:50
 * @Version 1.0
 */
@RestController
@Slf4j
@RequestMapping("syll")
public class WeiTuoXinXiController {

    @Autowired
    private IWeiTuoXinXiService weiTuoXinXiService;
    @Autowired
    private RedisCache redisCache;

    @GetMapping("/WeiTuoList")
    public ApiResponse getWeiTuoList(HttpServletRequest request){
        try {
            Map<String,String> map = new HashMap<>();
            map.put("LengKuID",request.getParameter("lengKuID"));
            ApiResponse apiResponse = this.weiTuoXinXiService.selectWeiTuoXinXiList(map);
            return apiResponse;
        } catch (Exception e) {
            log.error("WeiTuoXinXiController.getGamgetWeiTuoListeList.请稍后再试:" + e.getMessage());
            return ApiResponse.error(Constant.COMMON_PARAMETER_DEGRADE);
        }
    }

}
